package cn.sc.allinpay.allfavour.base.connect.socket.connectfactory;

import cn.sc.allinpay.allfavour.base.connect.socket.connection.AllinpayConnection;
import cn.sc.allinpay.allfavour.base.connect.socket.connection.Connection;
import cn.sc.allinpay.allfavour.business.common.app.Global;

/**
 * 通联连接构造器
 * author：pany
 * on 2017/11/15 14:00
 */
public class AllinpayConnectionFactory implements ConnectionFactory {

    @Override
    public Connection create() {
        return new AllinpayConnection() {
            @Override
            protected ConnectParameter getConnectParameter() {
                ConnectParameter parameter = new ConnectParameter();
                Global global = Global.getInstance();
                //TODO:
//                String ip = global.getPosInfo().getPOSIP();
//                int port = global.getPosInfo().getPOSPORT();
//                parameter.setIp(ip);
//                parameter.setPort(port);
//                parameter.setTimeout(30);//秒为单位
//                Loger.d("请求ip：" + ip);
//                Loger.d("请求port：" + port);
                return parameter;
            }
        };
    }
}
